const router = require('koa-router')() // 一边导入一边实例化
// 操作数据库的接口
const { getToken, Deleteurl } = require('../../config/databaseapi.js')
// 注册接口
router.post('/deleteactivity', async (ctx) => {
	console.log('调用删除党建活动信息接口')
	const { _id } = ctx.request.body;
	const query = `db.collection("activity_info").where({_id:"${_id}"}).remove()`;
	const res = await new getToken().posteve(Deleteurl, query);
	if (res.errcode === 0) {
		ctx.body = { msg: "删除成功", status: 1 }
	} else {
		ctx.body = { msg: "删除失败", status: 0 }
	}
})

module.exports = router.routes()